import Vuex from 'vuex';
import Vue from 'vue';
import createPersistedState from 'vuex-persistedstate';
import UsersModule from './modules/UsersModule';
import ProductsModule from './modules/ProductsModule';

Vue.use(Vuex);
export default new Vuex.Store({
    plugins: [createPersistedState({
        key:'vuex'
    })],
    modules: {
        users:UsersModule,
        products: ProductsModule
    },
    state: {
        /*登录状态*/
        ifSign: false
    },
    getters: {

    },
    mutations: {
        setSignTrue(state){
            state.ifSign = true;
        },
        setSignFalse(state){
            state.ifSign = false;
        }
    },
    actions: {
        
    }
});
